//
// Created by hay boy on 2022/6/17.
//

#ifndef ALGORITHMS_EXTENDEDCHAIN_H
#define ALGORITHMS_EXTENDEDCHAIN_H

#include "../linearList/ExtendedLinearList.h"
#include "ChainNode.h"
#include "Chain.cpp"

template<class T>
class ExtendedChain:public Chain<T>{
public:
    explicit ExtendedChain(int initialCapacity=10);
    ExtendedChain(const ExtendedChain<T>&);
    ~ExtendedChain()=default;
    virtual void clear();
    virtual void push_back(const T& theElement);
    void erase(int theIndex);
    void insert(int theIndex,const T& theElement);
    template<class Y>
    friend ostream &operator<<(ostream &out, const ExtendedChain<Y> &x);
protected:
    ChainNode<T>* lastNode;
};




#endif //ALGORITHMS_EXTENDEDCHAIN_H
